package com.ydd.app.dao.impl;


public class AccountDaoSql {
	
	/**
	 *  查询customer token
	 */
	
	public final static String QUERY_CUSTOMER_TOKEN_SQL = 
				" SELECT "
			    +"  token  "
			    +" FROM "
			    +"  customer_token_mst "
			    +" where "
			    +"  customer_id = ? ";
	
	
	/**
	 *  查询Employees token
	 */
	
	public final static String QUERY_EMPLOYEES_TOKEN_SQL = 
				" SELECT "
			    +"  token  "
			    +" FROM "
			    +"  Employees_token_mst "
			    +" where "
			    +"  employees_id = ? ";
	
	/**
	 * 创建 Employees token
	 */
	public final static String INSERT_INTO_TOKEN_FOR_EMPLOYESS_SQL = 
			" insert into  "
			 +"  Employees_token_mst (token,employees_id)  "
			 +" values(?,?)";
	
	/**
	 * 创建 customer token
	 */
	public final static String INSERT_INTO_TOKEN_FOR_CUSTOMER_SQL = 
			" insert into  "
			 +"  customer_token_mst (token,customer_id)  "
			 +" values(?,?)";
	
	/**
	 * 更新Employees token
	 */
	public final static String UPDATE_INTO_TOKEN_FOR_EMPLOYESS_SQL = 
			" update Employees_token_mst set token = ? where employees_id = ?  ";
	
	/**
	 * 更新customer token
	 */
	public final static String UPDATE_INTO_TOKEN_FOR_CUSTOMER_SQL = 
			" update customer_token_mst set token = ? where customer_id = ?  ";
	
	/**
	 * customer 注册
	 */
	public final static String INSERT_CUSTOMER_SQL = 
			" update customer_token_mst set token = ? where customer_id = ?  ";
	
	/**
	 * 根据 customer_id 查询 customer
	 */
	public final static String QUERY_CUSTOMER_BY_CUSTOMER_ID_SQL = 
			" SELECT "
			+" SysID "
			+" ,Name "
			+" ,DiYu "
			+" ,ShengShiXian "
			+" ,FZR "
			+" ,ShouJi "
			+" ,YouBian "
			+" ,JiaoTongZhuangKuang "
			+" ,CanYeDingWei "
			+" ,GuLiYinJinCanYe "
			+" ,GuiHuaYongDiMianJi "
			+" ,DiJia "
			+" ,SuiJia "
			+" ,DianJia "
			+" ,NaoDongLiShuLiang"
			+" ,ChengBen "
			+" ,SuiShouZhengChe "
			+" ,FuWuHuanJin"
			+" ,XianYouZhuYaoCanYe "
			+" ,PeiTaoQingKuang "
			+" ,ZhiMingQiYe "
			+" ,ShangHui "
			+" ,DuiJieBuMen "
			+" ,DuiJieBuMenFuZhiRen "
			+" ,DuiJieBuMenFuZhiRenShouJi "
			+" ,DuiJieBuMenFuZhiRenYouXiang "
			+" ,UserID"
			+" ,UserPAssword "
			+" ,SystemOper"
			+" ,SystemTime "
			+" ,LaiYuan "
			+" FROM "
			+" TBL_UserInfo "
			+" where UserID = ? ";
	
	/**
	 * 根据 customer_id 查询 customer
	 */
	public final static String QUERY_CUSTOMER_BY_ID_SQL = 
			" SELECT "
			+" SysID "
			+" ,Name "
			+" ,DiYu "
			+" ,ShengShiXian "
			+" ,FZR "
			+" ,ShouJi "
			+" ,YouBian "
			+" ,JiaoTongZhuangKuang "
			+" ,CanYeDingWei "
			+" ,GuLiYinJinCanYe "
			+" ,GuiHuaYongDiMianJi "
			+" ,DiJia "
			+" ,SuiJia "
			+" ,DianJia "
			+" ,NaoDongLiShuLiang"
			+" ,ChengBen "
			+" ,SuiShouZhengChe "
			+" ,FuWuHuanJin"
			+" ,XianYouZhuYaoCanYe "
			+" ,PeiTaoQingKuang "
			+" ,ZhiMingQiYe "
			+" ,ShangHui "
			+" ,DuiJieBuMen "
			+" ,DuiJieBuMenFuZhiRen "
			+" ,DuiJieBuMenFuZhiRenShouJi "
			+" ,DuiJieBuMenFuZhiRenYouXiang "
			+" ,UserID"
			+" ,UserPAssword "
			+" ,SystemOper"
			+" ,SystemTime "
			+" ,LaiYuan "
			+" FROM "
			+" TBL_UserInfo "
			+" where SysID = ? ";
	
	/**
	 * 根据 id 查询 Employees  
	 */
	public final static String QUERY_EMPLOYEES_BY_ID_SQL = 
			" select "
            +" op.ID, "
            +" op.Active_Time, "
            +" op.Address, "
            +" op.Birthday, "
            +" op.Email, "
            +" op.Gender, "
            +" op.Invalid_Time, "
            +" op.IsConfig, "
            +" op.Name as OperatorName, "
            +" op.Password, "
            +" op.Phone, "
            +" op.Remark, "
            +" op.Role, "
            +" op.State, "
            +" op.UNIT_ID, "
            +" orc.Organizeid, "
            +" orc.OperatorType, "
            +" orc.Memo, "
            +" orz.Create_Date, "
            +" orz.Explain, "
            +" orz.Name as OrganizeName, "
            +" orz.Level, "
            +" orz.Parent_ID, "
            +" orz.SZM, "
            +" orz.Title, "
            +" orz.TitlePicture, "
            +" orz.URL "
            +" from "
            +" Operator as op "
            +" inner join OrganizeOperatorConfig as orc on op.ID = orc.OperatorID "
            +" inner join Organize as orz on orz.ID = orc.Organizeid "
            +" where "
            +" op.ID = ?  ";
	
	public final static String INSERT_CUSTOME_SQL = 
			" insert into TBL_UserInfo( SysID,"
			+" Name "
			+" ,DiYu "
			+" ,ShengShiXian "
			+" ,FZR "
			+" ,ShouJi "
			+" ,YouBian "
			+" ,JiaoTongZhuangKuang "
			+" ,CanYeDingWei "
			+" ,GuLiYinJinCanYe "
			+" ,GuiHuaYongDiMianJi "
			+" ,DiJia "
			+" ,SuiJia "
			+" ,DianJia "
			+" ,NaoDongLiShuLiang"
			+" ,ChengBen "
			+" ,SuiShouZhengChe "
			+" ,FuWuHuanJin"
			+" ,XianYouZhuYaoCanYe "
			+" ,PeiTaoQingKuang "
			+" ,ZhiMingQiYe "
			+" ,ShangHui "
			+" ,DuiJieBuMen "
			+" ,DuiJieBuMenFuZhiRen "
			+" ,DuiJieBuMenFuZhiRenShouJi "
			+" ,DuiJieBuMenFuZhiRenYouXiang "
			+" ,UserID"
			+" ,UserPAssword "
			+" ,SystemOper"
			+" ,LaiYuan) "
//			+" values (  '{'+newid()+'}',?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
	+" values ( newid(),?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
	
	
	/**
	 * 查新所有注册用户
	 */
	public final static String QUERY_ALl_CUSTOMER_SQL = 
			" SELECT "
			+" SysID "
			+" ,Name "
			+" ,DiYu "
			+" ,ShengShiXian "
			+" ,FZR "
			+" ,ShouJi "
			+" ,YouBian "
			+" ,JiaoTongZhuangKuang "
			+" ,CanYeDingWei "
			+" ,GuLiYinJinCanYe "
			+" ,GuiHuaYongDiMianJi "
			+" ,DiJia "
			+" ,SuiJia "
			+" ,DianJia "
			+" ,NaoDongLiShuLiang"
			+" ,ChengBen "
			+" ,SuiShouZhengChe "
			+" ,FuWuHuanJin"
			+" ,XianYouZhuYaoCanYe "
			+" ,PeiTaoQingKuang "
			+" ,ZhiMingQiYe "
			+" ,ShangHui "
			+" ,DuiJieBuMen "
			+" ,DuiJieBuMenFuZhiRen "
			+" ,DuiJieBuMenFuZhiRenShouJi "
			+" ,DuiJieBuMenFuZhiRenYouXiang "
			+" ,UserID"
			+" ,UserPAssword "
			+" ,SystemOper"
			+" ,SystemTime "
			+" ,ActiveTime "
			+" ,InvalidTime"
			+" ,SendID "
			+" ,LaiYuan "
			+" FROM "
			+" TBL_UserInfo order by SystemTime desc ";
	
	/**
	 * 查新所有注册用户
	 */
	public final static String INSERT_CUSTOMER_ALL_SQL = 
			" insert into TBL_UserInfo ( "
			+" SysID, "
			+" Name, "
			+" DiYu, "
			+" ShengShiXian, "
			+" FZR, "
			+" ShouJi, "
			+" YouBian, "
			+" JiaoTongZhuangKuang, "
			+" CanYeDingWei, "
			+" GuLiYinJinCanYe, "
			+" GuiHuaYongDiMianJi, "
			+" DiJia, "
			+" SuiJia, "
			+" DianJia, "
			+" NaoDongLiShuLiang, "
			+" ChengBen, "
			+" SuiShouZhengChe, "
			+" FuWuHuanJin, "
			+" XianYouZhuYaoCanYe, "
			+" PeiTaoQingKuang, "
			+" ZhiMingQiYe, "
			+" ShangHui, "
			+" DuiJieBuMen, "
			+" DuiJieBuMenFuZhiRen, "
			+" DuiJieBuMenFuZhiRenShouJi, "
			+" DuiJieBuMenFuZhiRenYouXiang, "
			+" UserID, "
			+" UserPAssword, "
			+" SystemOper, "
			+" SystemTime, "
			+" LaiYuan, "
			+" ActiveTime, "
			+" InvalidTime, "
			+" SendID ) "
			+" values(?,?,?,?,?,?,?,?,?,?, ?,?,?,?,?,?,?,?,?,?, ?,?,?,?,?,?,?,?,?,?, ?,?,?,?) ";
	
	public final static String UPDATE_CUSTOMER_ALL_SQL = 
			" update TBL_UserInfo set  "
			+" Name = ? , "
			+" DiYu = ? , "
			+" ShengShiXian = ? , "
			+" FZR = ? , "
			+" ShouJi = ? , "
			+" YouBian = ? , "
			+" JiaoTongZhuangKuang = ? , "
			+" CanYeDingWei = ? , "
			+" GuLiYinJinCanYe = ? , "
			+" GuiHuaYongDiMianJi = ? , "
			+" DiJia = ? , "
			+" SuiJia = ? , "
			+" DianJia = ? , "
			+" NaoDongLiShuLiang = ? , "
			+" ChengBen = ? , "
			+" SuiShouZhengChe = ? , "
			+" FuWuHuanJin = ? , "
			+" XianYouZhuYaoCanYe = ? , "
			+" PeiTaoQingKuang = ? , "
			+" ZhiMingQiYe = ? , "
			+" ShangHui = ? , "
			+" DuiJieBuMen = ? , "
			+" DuiJieBuMenFuZhiRen = ? , "
			+" DuiJieBuMenFuZhiRenShouJi = ? , "
			+" DuiJieBuMenFuZhiRenYouXiang = ? , "
			+" UserID = ? , "
			+" UserPAssword = ? , "
			+" SystemOper = ? , "
			+" SystemTime = ? , "
			+" LaiYuan = ? , "
			+" ActiveTime = ? , "
			+" InvalidTime = ? , "
			+" SendID = ? " 
			+" where SysID = ?  ";
}
